import { createSlice } from '@reduxjs/toolkit'

export const userSlice=createSlice({
    name:"user",
    initialState:{
        userInfo:{},
        token:""
    },
    reducers:{
        loginSuccess(state, action){
            state.userInfo=action.payload.userInfo,
            state.token=action.payload.token
        }
    }
})
export const {loginSuccess}=userSlice.actions